<template>
	<view class="app">
		<view class="a-title">推荐文章</view>

		<view class="article-log">
			<view v-for="(item, index) in articleList" :key="index" class="center img-cet"
			@click="navTo(`/pages/articleall/detail?id=${item.id}`)">
				<image class="img-a" :src="item.img"></image>
			</view>
		</view>

		


	</view>
</template>

<script>
	import articleApi from '@/api/article.js'


	export default {

		async onLoad() {
			//查询数据

			this.loadArticleData()

		},
		data() {
			return {

				articleList: [], //推荐文章


			}
		},
		methods: {




			// 首页 推荐文章1
			async loadArticleData() {
				const {
					data
				} = await articleApi.getArticleAll()
				this.articleList = data
				console.log('bbb', this.articleList)
			},





		}
	}
</script>

<style lang="scss">
	.a-title {
		margin-top: 30rpx;
		margin-left: 30rpx;
		margin-bottom: 30rpx;
		width: 144rpx;
		height: 37rpx;
		font-size: 36rpx;
		font-family: Microsoft YaHei;
		font-weight: bold;
		color: #333333;
	}

	.img-cet {
		margin-bottom: 30rpx;
	}

	.img-a {
		width: 690rpx;
		height: 280rpx;
		border-radius: 20rpx;
	}
</style>
